package cays.student.service;

import cays.student.dao.StudentDao;
import cays.student.vo.Student;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 学生信息业务层
 *
 * @author Chai yansheng
 * @create 2019/8/29
 **/
@Service
public class StudentService {
    @Resource
    private StudentDao studentDao;

    public Student getStudentBySno(String sno) {
        return studentDao.getStudentBySno(sno);
    }

    public List<Student> getAllStudent() {
        return studentDao.getAllStudent();
    }

    @Transactional
    public int updateStudentBySno(Student student) {
        return studentDao.updateStudentBySno(student);
    }

    @Transactional
    public int insertStudent(Student student) {
        return studentDao.insertStudent(student);
    }

    @Transactional
    public int deleteStudentBySno(String sno) {
        return studentDao.deleteStudent(sno);
    }

}
